package org.example.chainOfResponsibility.correctMethodEvolution.handler;
import org.example.chainOfResponsibility.correctMethodEvolution.GatewayHandler;

/**
 * @author weigang
 * @create 2022-07-26 10:17
 */
public class FirstPassHandler extends GatewayHandler {

    private int play(){
        return 80;
    }

    @Override
    public int handler() {
        System.out.println("第一关-->FirstPassHandler");
        int score = play();
        if(score >= 80){
            //分数>=80 并且存在下一关才进入下一关
            if(this.next != null){
                return this.next.handler();
            }
        }
        return score;
    }
}
